package text;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/addTextBook")
public class AddTextBookServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        response.setContentType("text/html;charset=UTF-8");

        String textBookId = request.getParameter("textBookId");
        String textBookName = request.getParameter("textBookName");
        String author = request.getParameter("author");
        String price = request.getParameter("price");
        String isNational = request.getParameter("isNational");
        String textBookCategory = request.getParameter("textBookCategory");
        String remark = request.getParameter("remark");
        PrintWriter out = response.getWriter();
        out.println("教材编号: " + textBookId);
        out.println("教材名: " + textBookName);
        out.println("作者: " + author);
        out.println("价格: " + price);
        out.println("是否国规教材: " + isNational);
        out.println("教材类别: " + textBookCategory);
        out.println("备注: " + remark);
    }


    }
